package kingwing.dc.core.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import com.bstek.dorado.annotation.PropertyDef;

/**
 * 规则详细抽取项（规则表外键）
 * @author Kevin
 * 2017年8月11日
 */
@Entity
@Table(name="DC_RULE_DETAIL")
public class RuleDetail extends BaseEntity {

	private static final long serialVersionUID = 4938295990134173868L;
	
	@PropertyDef(label="规则ID")
	@Column(name="RULE_ID_",length=512)
	private String ruleId;
	
	/**
	 * 自定义获取内容的标题
	 */
	@PropertyDef(label="自定义标题名称")
	@Column(name="RULE_DETAIL_NAME_",length=512)
	private String ruleDetailName;
	
	/**
	 * 选择器（默认使用Xpath）
	 */
	@PropertyDef(label="选择器")
	@Column(name="RULE_DETAIL_SELECTOR_",length=512)
	private String ruleDetailSelector;
	
	/**
	 * 是否允许获取的内容为空！
	 */
	@PropertyDef(label="是否为空")
	@Column(name="RULE_DETAIL_REQUIRED_",length=512)
	private boolean ruleDetailRequired;
	
	@PropertyDef(label="自定义标题类型" ,description="0:标题,1:正文,2:时间,3:URL,4:列表")
	@Column(name="fieldType" ,length=512)
	private int fieldType;
	
	@PropertyDef(label="作为信息列显示",description="true:显示;false:不显示")
	@Column(name="rule_Detail_Column_",length=512)
	private boolean ruleDetailColumn = true;

	public String getRuleId() {
		return ruleId;
	}

	public void setRuleId(String ruleId) {
		this.ruleId = ruleId;
	}

	public String getRuleDetailName() {
		return ruleDetailName;
	}

	public void setRuleDetailName(String ruleDetailName) {
		this.ruleDetailName = ruleDetailName;
	}

	public String getRuleDetailSelector() {
		return ruleDetailSelector;
	}

	public void setRuleDetailSelector(String ruleDetailSelector) {
		this.ruleDetailSelector = ruleDetailSelector;
	}

	public boolean isRuleDetailRequired() {
		return ruleDetailRequired;
	}

	public void setRuleDetailRequired(boolean ruleDetailRequired) {
		this.ruleDetailRequired = ruleDetailRequired;
	}

	public boolean isRuleDetailColumn() {
		return ruleDetailColumn;
	}

	public void setRuleDetailColumn(boolean ruleDetailColumn) {
		this.ruleDetailColumn = ruleDetailColumn;
	}

	/**
	 * @return 0:标题  1:内容  2:时间  3:URL
	 */
	public int getFieldType() {
		return fieldType;
	}

	public void setFieldType(int fieldType) {
		this.fieldType = fieldType;
	}

}
